package C;

import java.util.Scanner;

public class C31 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(),e = sc.nextInt();
        int offset = 0;
        long area = 0;
        int pre = 0;
        for (int i=0;i<n;i++) {
            int x = sc.nextInt();
            area += Math.abs((x-pre)*offset);
            System.out.println("area="+area);
            pre = x;
            offset = offset+sc.nextInt();
            System.out.println("offset="+offset);
        }
        area+=Math.abs((e-pre)*offset);
        System.out.println("area="+area);
    }
}
